//
//  NewsCollectionViewCell.m
//  Zaker
//
//  Created by 赵磊 on 16/3/10.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "NewsCollectionViewCell.h"

@implementation NewsCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
// 图片
        self.img = [[UIImageView alloc]init];
        _img.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_img];
// lable
        self.lable = [[UILabel alloc]init];
    [self.contentView addSubview:_lable];
}
    return self;
}
//布局
-(void)layoutSubviews
{
    [super layoutSubviews];
    _img.frame = CGRectMake(0, 0, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.img.layer.cornerRadius = _img.frame.size.width / 2;
    self.img.clipsToBounds = YES;
    _lable.frame = CGRectMake(_img.frame.origin.x + _img.frame.size.width / 3, _img.frame.origin.y + _img.frame.size.height, 40, 20);
    _lable.font = [UIFont systemFontOfSize:15];
    _lable.tintColor = [UIColor grayColor];
}

@end
